<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>YiChangKong For Blog</title><meta name="author" content="伊长空"><meta name="copyright" content="伊长空"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta http-equiv="Cache-Control" content="no-transform"><meta http-equiv="Cache-Control" content="no-siteapp"><meta name="description" content="空气越稀薄 、风景越广阔">
<meta property="og:type" content="website">
<meta property="og:title" content="YiChangKong For Blog">
<meta property="og:url" content="https://yichangkong.gitee.io/page/3/index.html">
<meta property="og:site_name" content="YiChangKong For Blog">
<meta property="og:description" content="空气越稀薄 、风景越广阔">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gitee.com/yichangkong/FigureBed/raw/master/img/20200417183933.png">
<meta property="article:author" content="伊长空">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://gitee.com/yichangkong/FigureBed/raw/master/img/20200417183933.png"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="https://yichangkong.gitee.io/page/3/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css"><script>var GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  ClickShowText: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  justifiedGallery: {
    js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
    css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isanchor: false
};

var saveToLocal = {
  set: function setWithExpiry(key, value, ttl) {
    const now = new Date()
    const expiryDay = ttl * 86400000
    const item = {
      value: value,
      expiry: now.getTime() + expiryDay,
    }
    localStorage.setItem(key, JSON.stringify(item))
  },

  get: function getWithExpiry(key) {
    const itemStr = localStorage.getItem(key)

    if (!itemStr) {
      return undefined
    }
    const item = JSON.parse(itemStr)
    const now = new Date()

    if (now.getTime() > item.expiry) {
      localStorage.removeItem(key)
      return undefined
    }
    return item.value
  }
}</script><script id="config_change">var GLOBAL_CONFIG_SITE = { 
  isPost: false,
  isHome: true,
  isHighlightShrink: false,
  isToc: false,
  postUpdate: '2022-04-29 19:56:44'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(function () {  window.activateDarkMode = function () {
    document.documentElement.setAttribute('data-theme', 'dark')
    if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
    }
  }
  window.activateLightMode = function () {
    document.documentElement.setAttribute('data-theme', 'light')
   if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
    }
  }
  const autoChangeMode = 'false'
  const t = saveToLocal.get('theme')
  if (autoChangeMode === '1') {
    const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
    const isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches
    const isNotSpecified = window.matchMedia('(prefers-color-scheme: no-preference)').matches
    const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
    if (t === undefined) {
      if (isLightMode) activateLightMode()
      else if (isDarkMode) activateDarkMode()
      else if (isNotSpecified || hasNoSupport) {
        const now = new Date()
        const hour = now.getHours()
        const isNight = hour <= 6 || hour >= 18
        isNight ? activateDarkMode() : activateLightMode()
      }
      window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) {
        if (saveToLocal.get('theme') === undefined) {
          e.matches ? activateDarkMode() : activateLightMode()
        }
      })
    } else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else if (autoChangeMode === '2') {
    const now = new Date()
    const hour = now.getHours()
    const isNight = hour <= 6 || hour >= 18
    if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
    else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else {
    if (t === 'dark') activateDarkMode()
    else if (t === 'light') activateLightMode()
  }const asideStatus = saveToLocal.get('aside-status')
if (asideStatus !== undefined) {
   if (asideStatus === 'hide') {
     document.documentElement.classList.add('hide-aside')
   } else {
     document.documentElement.classList.remove('hide-aside')
   }
}})()</script><meta name="generator" content="Hexo 5.2.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" src="https://gitee.com/yichangkong/FigureBed/raw/master/img/20200417183933.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">45</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">9</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">45</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div></div></div></div><div id="body-wrap"><header class="full_page" id="page-header" style="background-image: url(https://gitee.com/yichangkong/FigureBed/raw/master/img/90603fc7fc45014e0c69aede05963ef2.jpg)"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">YiChangKong For Blog</a></span><span id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div></div><span class="close" id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></span></span></nav><div id="site-info"><h1 id="site-title">YiChangKong For Blog</h1><div id="site-subtitle"><span id="subtitle"></span></div><div id="site_social_icons"><a class="social-icon" href="https://github.com/yichangkong" rel="external nofollow noreferrer" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:changkongyi@gmail.com" rel="external nofollow noreferrer" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left_radius"><a href="/2020/05/29/Concurrent%20Overview/" title="Concurrent Overview">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Concurrent Overview"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/05/29/Concurrent%20Overview/" title="Concurrent Overview">Concurrent Overview</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-05-29T08:34:58.000Z" title="发表于 2020-05-29 16:34:58">2020-05-29</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox article-meta__icon"></i><a class="article-meta__categories" href="/categories/Java/">Java</a><i class="fas fa-angle-right"></i><a class="article-meta__categories" href="/categories/Java/%E9%AB%98%E5%B9%B6%E5%8F%91%E4%B8%8E%E5%A4%9A%E7%BA%BF%E7%A8%8B/">高并发与多线程</a><i class="fas fa-angle-right"></i><a class="article-meta__categories" href="/categories/Java/%E9%AB%98%E5%B9%B6%E5%8F%91%E4%B8%8E%E5%A4%9A%E7%BA%BF%E7%A8%8B/Concurrent/">Concurrent</a></span></div><div class="content"> 并发包概述
提前话：
进行myCat摸索时到处可见的并发包的原子性数据操作，与其摸瞎子过河，不如先把瞎子摸一遍！！！🤔 于是便有了下面这片的技术博客（关于concurrent概述）🤨

Overview of the java.util.concurrent（概述）原文网址
Main Components（主要构成）The java.util.concurrent contains way too many features to discuss in a single write-up. In this article, we will mainly focus on some of the most useful utilities from this package like:（在这片文章中如果一次撰写或讨论concurrent的功能、方式会太多，所以我们将大部分的精力集中于最常使用的实用程序）

Executor（执行者）
ExecutorService（执行器服务）
ScheduledExecutorService（执行器服务时间表）
Future（）
CountDow ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/2020/05/26/Volatile%20Keyword/" title="Volatile Keyword">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Volatile Keyword"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/05/26/Volatile%20Keyword/" title="Volatile Keyword">Volatile Keyword</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-05-26T08:34:58.000Z" title="发表于 2020-05-26 16:34:58">2020-05-26</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox article-meta__icon"></i><a class="article-meta__categories" href="/categories/Java/">Java</a><i class="fas fa-angle-right"></i><a class="article-meta__categories" href="/categories/Java/Volatile/">Volatile</a></span></div><div class="content">概念解析👩‍💻 👨‍💻

被volatile修饰的变量能够保证每个线程能够获取该变量的最新值，从而避免出现数据脏读的现象。
volatile关键字虽然从字面上理解起来比较简单，但是要用好不是一件容易的事情。由于volatile关键字是与Java的内存模型有关的
因此在讲述volatile关键之前，我们先来了解一下与内存模型相关的概念和知识，然后分析了volatile关键字的实现原理，最后给出了几个使用volatile关键字的场景。


内存模型的相关概念高速缓存

计算机在执行程序时，每条指令都是在CPU中执行的，而执行指令过程中，势必涉及到数据的读取和写入。
由于程序运行过程中的临时数据是存放在主存（物理内存）当中的，这时就存在一个问题，由于CPU执行速度很快，而从内存读取数据和向内存写入数据的过程跟CPU执行指令的速度比起来要慢的多，因此如果任何时候对数据的操作都要通过和内存的交互来进行，会大大降低指令执行的速度。
因此在CPU里面就有了高速缓存。也就是，当程序在运行过程中，会将运算需要的数据从主存复制一份到CPU的高速缓存当中。
那么CPU进行计算时就可以直接从它的高速缓 ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/2020/05/22/BinaryTree%20Overview/" title="BinaryTree Overview">     <img class="post_bg" src="https://gitee.com/yichangkong/FigureBed/raw/master/img/20201123185203.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="BinaryTree Overview"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/05/22/BinaryTree%20Overview/" title="BinaryTree Overview">BinaryTree Overview</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-05-22T08:34:58.000Z" title="发表于 2020-05-22 16:34:58">2020-05-22</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox article-meta__icon"></i><a class="article-meta__categories" href="/categories/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/">数据结构</a><i class="fas fa-angle-right"></i><a class="article-meta__categories" href="/categories/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/BinaryTree/">BinaryTree</a></span></div><div class="content">why we Need it？ 🤑

我们前面学习了那么多的数据结构 增删改查都有优化了 还需要再学习一个奇怪的树结构的数据处理方式呢？

🆗 follow me！

我们先进行一个比较

数组 （数组存储方式的分析）


优点：

通过下标方式访问元素，速度快。对于有序数组，还可使用二分查找提高检索速度。


缺点 ：

如果要检索具体某个值，或者插入值( 按一定顺序 ) 会整体移动，效率较低 [示意图]







链表 （链式存储方式的分析）


优点：

在一定程度上对数组存储方式有优化(比如：插入一个数值节点，只需要将插入节点，链接到链表中即可，
删除效率也很好)。


缺点 ：

缺点：在进行检索时，效率仍然较低，比如(检索某个值，需要从头节点开始遍历) 【示意图】







SO 这时候我们就开始YY了 当我们进行业务数据的处理里时，就可能会考虑到，我到底用那个方式好呢？ 当然撒刁才做选择 ！！！！我tm都要（大家底下评论666🤙 ），这时 树结构就腾空出“事”了！！

树存储方式的分析

能提高数据存储，读取的效率, 比如利用 二叉排序树(Binary So ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/2020/05/14/JVM%20Overview/" title="JVM Overview">     <img class="post_bg" src="https://gitee.com/yichangkong/FigureBed/raw/master/img/20200511210319.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="JVM Overview"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/05/14/JVM%20Overview/" title="JVM Overview">JVM Overview</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-05-14T08:34:58.000Z" title="发表于 2020-05-14 16:34:58">2020-05-14</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox article-meta__icon"></i><a class="article-meta__categories" href="/categories/Java/">Java</a><i class="fas fa-angle-right"></i><a class="article-meta__categories" href="/categories/Java/JVM/">JVM</a></span></div><div class="content">
1.JVM is What?👇

JVM是Java Virtual Machine（Java虚拟机）的缩写，JVM是一种用于计算设备的规范，它是一个虚构出来的计算机，是通过在实际的计算机上仿真模拟各种计算机功能来实现的。
引入Java语言虚拟机后，Java语言在不同平台上运行时不需要重新编译。Java语言使用Java虚拟机屏蔽了与具体平台相关的信息，使得Java语言编译程序只需生成在Java虚拟机上运行的目标代码（字节码），就可以在多种平台上不加修改地运行。
虚拟机（Virtual Machine）指通过软件模拟的具有完整硬件系统功能的、运行在一个完全隔离环境中的完整计算机系统。在实体计算机中能够完成的工作在虚拟机中都能够实现。在计算机中创建虚拟机时，需要将实体机的部分硬盘和内存容量作为虚拟机的硬盘和内存容量。每个虚拟机都有独立的CMOS、硬盘和操作系统，可以像使用实体机一样对虚拟机进行操作。
Java虚拟机有自己完善的硬件架构，如处理器、堆栈等，还具有相应的指令系统。
Java虚拟机本质上就是一个程序，当它在命令行上启动的时候，就开始执行保存在某字节码文件中的指令。Java语言的 ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/2020/05/14/Netty%20Overview/" title="Netty Overview">     <img class="post_bg" src="https://gitee.com/yichangkong/FigureBed/raw/master/img/20201123145650.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Netty Overview"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/05/14/Netty%20Overview/" title="Netty Overview">Netty Overview</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-05-14T08:34:58.000Z" title="发表于 2020-05-14 16:34:58">2020-05-14</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox article-meta__icon"></i><a class="article-meta__categories" href="/categories/Java/">Java</a><i class="fas fa-angle-right"></i><a class="article-meta__categories" href="/categories/Java/Netty/">Netty</a></span></div><div class="content">****
简介

Netty 是一个广受欢迎的异步事件驱动的Java开源网络应用程序框架（java的NIO后浪🤙🤙），用于快速开发可维护的高性能协议服务器和客户端。



JDK 原生 NIO 程序的问题
JDK 原生也有一套网络应用程序 API，但是存在一系列问题，主要如下：

NIO 的类库和 API 繁杂，使用麻烦：你需要熟练掌握 Selector、ServerSocketChannel、SocketChannel、ByteBuffer 等。
需要具备其他的额外技能做铺垫：例如熟悉 Java 多线程编程，因为 NIO 编程涉及到 Reactor 模式，你必须对多线程和网路编程非常熟悉，才能编写出高质量的 NIO 程序。
可靠性能力补齐，开发工作量和难度都非常大：例如客户端面临断连重连、网络闪断、半包读写、失败缓存、网络拥塞和异常码流的处理等等。
NIO 编程的特点是功能开发相对容易，但是可靠性能力补齐工作量和难度都非常大。
JDK NIO 的 Bug：例如臭名昭著的 Epoll Bug，它会导致 Selector 空轮询，最终导致 CPU 100%。官方声称在 JDK 1.6 ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/2020/05/13/Zookeeper%20Overview/" title="Zookeeper Overview">     <img class="post_bg" src="https://gitee.com/yichangkong/FigureBed/raw/master/img/20200513175801.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Zookeeper Overview"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/05/13/Zookeeper%20Overview/" title="Zookeeper Overview">Zookeeper Overview</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-05-13T08:34:58.000Z" title="发表于 2020-05-13 16:34:58">2020-05-13</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox article-meta__icon"></i><a class="article-meta__categories" href="/categories/Java/">Java</a><i class="fas fa-angle-right"></i><a class="article-meta__categories" href="/categories/Java/Zookeeper/">Zookeeper</a></span></div><div class="content">
1.What is ZooKeeper?💫
ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services.
All of these kinds of services are used in some form or another by distributed applications. Each time they are implemented there is a lot of work that goes into fixing the bugs and race conditions that are inevitable.
Because of the difficulty of implementing these kinds of services, applications initially usually skim ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/2020/05/13/NIO%20Overview/" title="NIO Overview">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="NIO Overview"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/05/13/NIO%20Overview/" title="NIO Overview">NIO Overview</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-05-13T08:34:58.000Z" title="发表于 2020-05-13 16:34:58">2020-05-13</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox article-meta__icon"></i><a class="article-meta__categories" href="/categories/Java/">Java</a><i class="fas fa-angle-right"></i><a class="article-meta__categories" href="/categories/Java/NIO/">NIO</a></span></div><div class="content">NIO
数据定义缓冲区容器


NIO中有几个核心对象需要掌握：缓冲区（Buffer）、通道（Channel）、选择器（Selector）。


官方API介绍
NIO api的核心抽象:

Buffers，容器数据;
Charsets及其相关解码器和编码器,字节和Unicode字符之间的转换;
Channels各种类型的,这表示连接实体能够执行I / O操作;和
选择器和选择键,连同可选择的渠道定义一个multiplexed、non-blocking、I/O设施。
java.nio包定义缓冲区类,用于在整个NIO api。
java.nio.charset 包定义字符集API 。
通道选择器API中定义java.nio.channels包。这些子包都有自己的服务提供者(SPI)分装,可用于扩展的内容或构建替代实现平台的默认实现。





Buffers
描述



Buffer
Position, limit, and capacity; clear, flip, rewind, and mark/reset


ByteBuffer
Get/put, compact, views ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/2020/05/12/Mycat%20Overview/" title="Mycat Overview">     <img class="post_bg" src="https://gitee.com/yichangkong/FigureBed/raw/master/img/20201123150010.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Mycat Overview"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/05/12/Mycat%20Overview/" title="Mycat Overview">Mycat Overview</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-05-12T08:34:58.000Z" title="发表于 2020-05-12 16:34:58">2020-05-12</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox article-meta__icon"></i><a class="article-meta__categories" href="/categories/%E4%B8%AD%E9%97%B4%E4%BB%B6/">中间件</a><i class="fas fa-angle-right"></i><a class="article-meta__categories" href="/categories/%E4%B8%AD%E9%97%B4%E4%BB%B6/Mycat/">Mycat</a></span></div><div class="content">mycat起源👹（官方）

Mycat 背后是阿里曾经开源的知名产品——Cobar。Cobar 的核心功能和优势是 MySQL 数据库分片，此产品曾经广为流传，据说最早的发起者对 Mysql 很精通，后来从阿里跳槽了，阿里随后开源的 Cobar，并维持到 2013 年年初，然后，就没有然后了。
Cobar 的思路和实现路径的确不错。基于 Java 开发的，实现了 MySQL 公开的二进制传输协议，巧妙地将自己伪装成一个 MySQL Server，目前市面上绝大多数 MySQL 客户端工具和应用都能兼容。比自己实现一个新的数据库协议要明智的多，因为生态环境在哪里摆着。
Cobar 使用起来也非常方便。由于是基于 Java 语言开发的，下载下来解压，安装 JDK，然后配置几个不是很复杂的配置文件，猛击鼠标，就能启动 Cobar。
讲完起源，让我们开始将其层层打开。


mycat简述🌊

那么 Mycat 在整个行业领域归属何处呢？

数据库中间件

Mycat 是一个开源的分布式数据库系统，但是由于真正的数据库需要存储引擎，而 Mycat 并没有存
储引擎，所以并不是完全意义的分布式 ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/2020/04/29/Redis%E5%91%BD%E4%BB%A4%E8%A1%8C/" title="Redis命令行">     <img class="post_bg" src="https://gitee.com/yichangkong/FigureBed/raw/master/img/20200429161847.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Redis命令行"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/04/29/Redis%E5%91%BD%E4%BB%A4%E8%A1%8C/" title="Redis命令行">Redis命令行</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-04-29T08:34:58.000Z" title="发表于 2020-04-29 16:34:58">2020-04-29</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox article-meta__icon"></i><a class="article-meta__categories" href="/categories/Redis/">Redis</a><i class="fas fa-angle-right"></i><a class="article-meta__categories" href="/categories/Redis/%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E8%A1%8C/">常用命令行</a></span></div><div class="content">redis 命令行1、 Keys相关的命令操作：
（1） 查看key是否存在：

EXISTS key  Code  - ![](https://gitee.com/yichangkong/FigureBed/raw/master/img/20200429164311.png)（2） 查找满足pattern的keys：- ```properties  KEYS key* -  

（3） 查看key的超时时间：

PTTL key 以毫秒为单位返回 key 的剩余的过期时间。 Code  - ![](https://gitee.com/yichangkong/FigureBed/raw/master/img/20200429164701.png)（4） 遍历key：- ```properties  KEYS * -  

（5） 返回key的值的序列化：

DUMP KEY_NAME Code  - ![](https://gitee.com/yichangkong/FigureBed/raw/master/img/20200429164932.png)2、 字符串命令操作：（1） 设 ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/2020/04/26/SpringBoot%20Overview/" title="SpringBoot Overview">     <img class="post_bg" src="https://gitee.com/yichangkong/FigureBed/raw/master/img/20201123105202.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="SpringBoot Overview"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/04/26/SpringBoot%20Overview/" title="SpringBoot Overview">SpringBoot Overview</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-04-26T08:34:58.000Z" title="发表于 2020-04-26 16:34:58">2020-04-26</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox article-meta__icon"></i><a class="article-meta__categories" href="/categories/Spring/">Spring</a><i class="fas fa-angle-right"></i><a class="article-meta__categories" href="/categories/Spring/SpringBoot/">SpringBoot</a></span></div><div class="content">

官方文档解析
1.介绍Spring Boot
Spring Boot可以轻松创建可以运行的独立的，生产级的基于Spring的应用程序。我们对Spring平台和第三方库采取自己的看法，以便您尽可能轻松地使用本教程。大多数Spring Boot应用程序只需要很少的Spring配置。
您可以使用Spring Boot来创建可以使用java -jar或更传统的war部署来启动的Java应用程序 。我们还提供了一个运行“spring script”的命令行工具。
我们的主要目标是：

为所有Spring开发提供一个更快，更广泛的入门体验。
立即开始开发。
提供大型项目（如嵌入式服务器，安全性，指标，运行状况检查和外部配置）通用的一系列非功能性功能。
绝对不会生成代码，并且不需要XML配置。



springbooot
1.启动流程





</div></div></div><nav id="pagination"><div class="pagination"><a class="extend prev" rel="prev" href="/page/2/"><i class="fas fa-chevron-left fa-fw"></i></a><a class="page-number" href="/">1</a><a class="page-number" href="/page/2/">2</a><span class="page-number current">3</span><a class="page-number" href="/page/4/">4</a><a class="page-number" href="/page/5/">5</a><a class="extend next" rel="next" href="/page/4/"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside_content" id="aside_content"><div class="card-widget card-info"><div class="card-content"><div class="card-info-avatar is-center"><img class="avatar-img" src="https://gitee.com/yichangkong/FigureBed/raw/master/img/20200417183933.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/><div class="author-info__name">伊长空</div><div class="author-info__description">空气越稀薄 、风景越广阔</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">45</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">9</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">45</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/CodeSnakes"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/yichangkong" rel="external nofollow noreferrer" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:changkongyi@gmail.com" rel="external nofollow noreferrer" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div></div><div class="card-widget card-announcement"><div class="card-content"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">繁华落尽一场空 ：风往尘香花已尽 <br> 		<div class="is-center"> 欢迎访问 <br> <a class="bookmark button--primary" id="bookmark-it" href="https://jq.qq.com/?_wv=1027&amp;k=rCby8DjL" rel="external nofollow noreferrer" title="" target="_self"><i aria-hidden="true"> </i><span>Join QQ Group 👍</span></a></div></div></div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="card-content"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2022/04/28/JOIN-Clause/" title="JOIN_Clause"><img src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="JOIN_Clause"/></a><div class="content"><a class="title" href="/2022/04/28/JOIN-Clause/" title="JOIN_Clause">JOIN_Clause</a><time datetime="2022-04-28T15:42:04.000Z" title="发表于 2022-04-28 23:42:04">2022-04-28</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/03/24/Vim%E9%94%AE%E4%BD%8D%E5%9B%BE/" title="Vim键位图"><img src="https://gitee.com/yichangkong/FigureBed/raw/master/img/vi-vim-cheat-sheet-sch.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Vim键位图"/></a><div class="content"><a class="title" href="/2022/03/24/Vim%E9%94%AE%E4%BD%8D%E5%9B%BE/" title="Vim键位图">Vim键位图</a><time datetime="2022-03-24T03:32:15.000Z" title="发表于 2022-03-24 11:32:15">2022-03-24</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/01/12/requirejs%20Overview/" title="RequireJs Overview"><img src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="RequireJs Overview"/></a><div class="content"><a class="title" href="/2021/01/12/requirejs%20Overview/" title="RequireJs Overview">RequireJs Overview</a><time datetime="2021-01-12T02:43:34.000Z" title="发表于 2021-01-12 10:43:34">2021-01-12</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2020/12/12/SSM%E6%9E%B6%E6%9E%84%E4%B8%8B%E7%9A%84Cors%E8%B7%A8%E5%9F%9F%E9%97%AE%E9%A2%98/" title="SSM架构下的Cors跨域问题"><img src="https://gitee.com/yichangkong/FigureBed/raw/master/img/20201213132701.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="SSM架构下的Cors跨域问题"/></a><div class="content"><a class="title" href="/2020/12/12/SSM%E6%9E%B6%E6%9E%84%E4%B8%8B%E7%9A%84Cors%E8%B7%A8%E5%9F%9F%E9%97%AE%E9%A2%98/" title="SSM架构下的Cors跨域问题">SSM架构下的Cors跨域问题</a><time datetime="2020-12-12T13:13:28.000Z" title="发表于 2020-12-12 21:13:28">2020-12-12</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2020/11/25/DataTable/" title="DataTable"><img src="https://gitee.com/yichangkong/FigureBed/raw/master/img/20201125100521.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="DataTable"/></a><div class="content"><a class="title" href="/2020/11/25/DataTable/" title="DataTable">DataTable</a><time datetime="2020-11-25T01:45:41.000Z" title="发表于 2020-11-25 09:45:41">2020-11-25</time></div></div></div></div></div><div class="card-widget card-categories"><div class="card-content"><div class="item-headline"><i class="fas fa-folder-open"></i><span>分类</span></div><ul class="card-category-list" id="aside-cat-list">
            <li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Algorithm/"><span class="card-category-list-name">Algorithm</span><span class="card-category-list-count">2</span></a></li><ul class="card-category-list child"><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Algorithm/Algorithm-Complexity/"><span class="card-category-list-name">Algorithm Complexity</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Algorithm/%E5%90%8E%E7%BC%80%E8%A1%A8%E8%BE%BE%E5%BC%8F/"><span class="card-category-list-name">后缀表达式</span><span class="card-category-list-count">1</span></a></li></ul><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Flutter/"><span class="card-category-list-name">Flutter</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Git/"><span class="card-category-list-name">Git</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Java/"><span class="card-category-list-name">Java</span><span class="card-category-list-count">10</span></a></li><ul class="card-category-list child"><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Java/JVM/"><span class="card-category-list-name">JVM</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Java/NIO/"><span class="card-category-list-name">NIO</span><span class="card-category-list-count">1</span></a></li></ul>
            <li class="card-category-list-item more is-center"><a class="card-category-list-link-more" href="/categories/">
                <span>查看更多</span><i class="fas fa-angle-right"></i></a></li>
            </ul></div></div><div class="card-widget card-tags"><div class="card-content"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/tags/MySQL/" style="font-size: 1.1em; color: #999">MySQL</a> <a href="/tags/spring/" style="font-size: 1.1em; color: #999">spring</a> <a href="/tags/vim/" style="font-size: 1.1em; color: #999">vim</a> <a href="/tags/%E6%8A%80%E6%9C%AF/" style="font-size: 1.37em; color: #99a4b2">技术</a> <a href="/tags/%E6%8A%80%E6%9C%AF%E6%96%87%E6%A1%A3/" style="font-size: 1.37em; color: #99a4b2">技术文档</a> <a href="/tags/%E6%8A%80%E6%9C%AF%E6%A6%82%E5%BF%B5/" style="font-size: 1.1em; color: #999">技术概念</a> <a href="/tags/%E6%8A%80%E6%9C%AF%E6%A6%82%E8%BF%B0/" style="font-size: 1.5em; color: #99a9bf">技术概述</a> <a href="/tags/%E6%8A%80%E6%9C%AF%E7%BB%86%E8%8A%82/" style="font-size: 1.1em; color: #999">技术细节</a> <a href="/tags/%E9%9D%9E%E6%8A%80%E6%9C%AF/" style="font-size: 1.23em; color: #999ea6">非技术</a></div></div></div><div class="card-widget card-archives"><div class="card-content"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/04/"><span class="card-archive-list-date">四月 2022</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/03/"><span class="card-archive-list-date">三月 2022</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/01/"><span class="card-archive-list-date">一月 2021</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2020/12/"><span class="card-archive-list-date">十二月 2020</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2020/11/"><span class="card-archive-list-date">十一月 2020</span><span class="card-archive-list-count">5</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2020/10/"><span class="card-archive-list-date">十月 2020</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2020/09/"><span class="card-archive-list-date">九月 2020</span><span class="card-archive-list-count">3</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2020/08/"><span class="card-archive-list-date">八月 2020</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item more is-center"><a class="card-archive-list-link-more" href="/archives/">
              <span>查看更多</span><i class="fas fa-angle-right"  ></i></a></li></ul></div></div><div class="card-widget card-webinfo"><div class="card-content"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">45</div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2022-04-29T11:56:43.545Z"></div></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2022 By 伊长空</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener external nofollow noreferrer" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js"></script><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js"></script><div class="js-pjax"><script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><script src="https://cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js"></script></div></body></html>